Fixed the upgrade process of the websocket.