 Undo command not working as expected in UG