Fixed undo issue.