remove undo stack codes