Fixed the controller for categories