check internet connectivity before downloading