add error handling during aggregation