Fix bug where lack of internet connectivity leads app to crash