Fix crash when offline