Fixed S3 upload issue

Sorry for the delayed pull request. Something jumped in yesterday and my memory got lost.