Backport query fix