fixed previous bug in s3 helper