fixed new history patch after upstream changes