fixed cleanup bug