fixed S3 production code issues