fix bug in history