Fix cache clean up