Add count in the aggregating functions