updated s3 functions