adjusted the monitor-reconnection process