added handling of insertion of existing node to the tree