add socket.io client and minor tweak in code