Fix bug in s3 task