solve the problem when deleing the tempfolder