validate the form