How to add additional fields conditionally?