wrote the register controller.