Added code for socket.io