fixed UndoStack and RedoStack to remain in sync