fix bug when no results are returned for query-data