code to download data from s3