closing sockets when done