Added duplicate checking in TopicModel.relateExistingNodes