Better fix for yesterday's fix that uses correct sequence if file is deleted