save history.
Merge pull request #1 from pocke/save_hist

save history.