fix bug with interval aggregation