Modified AutoReconnect plugin