added support for dynamic s3 endpoints