fixed the found severe bug in the history command