fixing how text queries are handled