fix retrieval of relations