Patched the reconnecting proccess for websocket connections