Fix crash when there is no connectivity