fix movement of recursive query def