Fix counting issue