fix cleanup bug