Changed file delete logic.