bug fix for count

bug fix for count