fixed error in controller