diff --git a/src/cheats/cheatEditSlave.js b/src/cheats/cheatEditSlave.js
index 2fa37887fa593927340907ee83eec28e126bd8e8..54fea7440484ec731eea6e113e475e89f3b27b9b 100644
--- a/src/cheats/cheatEditSlave.js
+++ b/src/cheats/cheatEditSlave.js
@@ -83,8 +83,8 @@ App.UI.SlaveInteract.cheatEditSlave = function(slave) {
 		App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link(
 			"Apply cheat edits",
 			() => {
-				App.StartingGirls.cleanup(tempSlave);
-				V.slaves[V.slaveIndices[slave.ID]] = tempSlave;
+				App.StartingGirls.cleanup(V.tempSlave);
+				V.slaves[V.slaveIndices[slave.ID]] = V.tempSlave;
 				ibc.recalculate_coeff_id(slave.ID);
 				delete V.tempSlave;
 			},