fix crashes due to incorrect code in NetworkManager::Stop() function