support transitive relations properly