Added the ability to support multiple queries