Updated DownloadFunction