making keys only queries work correctly