adjusted for wild card queries