Fixed bug in controller.