This is the version with file deletion