fixed bug in query history on handling phrase