validator for registration