interim query fix, before refactor