added in checking for internet connection