Made it possible to close a connection