fix controller cleanup bug