fix memory leak on phrase query.