GUI: fixed the clear-undo bug