reworked validation for registration