Debugged the controller