fix count bug