Fixing socket.io communication from server to client