Fix bug: Handle potential IOexception correctly for deleted files.