Added validation to the form