hook in s3 logic