Added websocket reconnect code