debugged the controller