added validation to form