added validations and error messages for form