added function for s3