count bug fix