improve query lookup for #110