Validated the input to register method.