added the validation to the form