Trying to get query as string