take care of duplicate triples