adds validation on the forms