query ready; unit tests for query ready