socket.io fix and cleaning