Updated code to use socket.io 1.0