added history saving feature
added history saving feature