fix S3 delete code