fixed small counting issue