Fix for issue #847, app thinking it's in offline mode when failing to connect the first time