Fixed to avoid crashes when the websocket protocol is not recognized