added function to each input field