fixed history-substring-search