fix a count bug