Validating when the user submits the form