Added a way to check for an internet connection