Added executing a query for the whole input sentece.