S3 upload bug fix