Changed to socket.io fuctionality