change code for displaying errors while inputting in form