bug-fix: reworking counts correctly with grouping