Added a closeconnection method in the communicator