better offline/online fixing for the websocket