diff --git a/src/uncategorized/saRelationships.tw b/src/uncategorized/saRelationships.tw
index 05ab346274d78453202ebdd0c55a8acfac15f202..db67b0c96e46d3355a15493502617ba4b33cfc37 100644
--- a/src/uncategorized/saRelationships.tw
+++ b/src/uncategorized/saRelationships.tw
@@ -75,7 +75,7 @@
 				<<set _SlaveJ = $slaves[_j]>>
 				<<setLocalPronouns _SlaveJ 2>>
 				<<if (_SlaveJ.ID != _SlaveI.ID) && (_SlaveJ.relationship == 0) && (_SlaveI.rivalryTarget != _SlaveJ.ID) && (_SlaveJ.assignment != "stay confined") && (_SlaveJ.fetish != "mindbroken")>>
-				<<if (_SlaveJ.ID == _S.Madam.ID) && (_SlaveI.assignment == "work in the brothel")>>
+				<<if (_SlaveJ.ID == $MadamID) && (_SlaveI.assignment == "work in the brothel")>>
 					<<if _SlaveJ.rules.relationship != "restrictive">>
 						_SlaveI.slaveName manages to ingratiate $himself with the Madam, _SlaveJ.slaveName. The two slaves have @@.lightgreen;struck up a friendship.@@
 						<<set _SlaveJ.relationship = 1, _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveI.relationship = 1, _SlaveI.relationshipTarget = _SlaveJ.ID>>