Fix fileDelete logic with pending list