Added error detection for if no internet connection