fix crash when no network