add "history" option + bug fix