Fix S3 task bug