Check context of aggregating functions