corrected output format of aggreagate query results