fixed some bugs with form validations