Add validation to register.