fix json generation for post aggregations