fix counter cache