fixes bug when aggregation returns no results