Rewrote code to download files to check internet connnectivity, and back-up files before downloading in case download fails.