Fixed a counting issue