improve handling of deleted files