fix count error bug