fixed aggregations bug