add the auto reconnect feature