save history bug fix