Fix toggling between online/offline mode