added socket.io and changed the way messages are sent