Added support for query as string