Added validation to a form