re-added validation functions to form