working logic for adding input feilds