handle some websocket corner cases