Changing socket.io code