fix entities relations