Fix unfinished code
Add clear manager hook