fix an issue with auto reconnect (another thread was not stopped)