add s3 logic