validator for registering