fixed the history bug