Fixed error in the UndoRedoHandler