switched to use functions in queryTools instead of executeQuery