added validation for the forms