close sockets after use