fix multiple aggregates with select