Changed S3 to use environment