fixed bug in s3 upload