bug fix in counter.