fix bug in history removing