Edit of code in add

edit of code in add due to bug found during the following sequence- undo
of edit, undo of add, redo of add.