moved password validation and mail validation at model