Add changes to get it working on amazon s3