fix file deletions when record is deleted or updated

add "delete file" too