As the title of this issue mention you need to add one line of code, otherwise all the nodes we be removed
if(found){// duplicated: value already exist on the treefound.meta.multiplicity=(found.meta.multiplicity||1)+1;// <2>newNode=found;// new line to add}