better handling of query result edge cases (no results, etc)