[bug fix] fix the bug in resetting element counters