fixed the bug in counter aggregation