fixing aggregates bug.