Fixed reconnect issue when websocket failed with error