Removed the unregistration and new registration while merging undoManagers