improve query test coverage