Download working again, modified to check for network connection before downloading