exit when the websocket closes