fixing problems with relations.