fix counter issue