Changed the way the agents is connected to the controller.