need to fix aggregation for intervals