added function to download file