fixes relationships for M2M