bug fix - count