fix delete resume file when error