Added support for multiple queries refs - #18419