websocket update code