updated to use socket.io