with function to download file from url