added safe type search to class Relation