fix a bug of the history