history bug fix