fixed history saving