added socket.disconnect() before unload