automatic save history name, and restory history file