Fixing error in controller.