added socket.io and added update loop