diff --git a/src/uncategorized/customSlave.tw b/src/uncategorized/customSlave.tw
index df6ab83e67f3cdb8d64e3f9728b0a6d063edf160..be3343abd319c491c857038d96f46692d79dd384 100644
--- a/src/uncategorized/customSlave.tw
+++ b/src/uncategorized/customSlave.tw
@@ -17,7 +17,8 @@
 <<elseif $customSlave.age < 20>>18-19 years old.
 <<elseif $customSlave.age < 25>>20-24 years old.
 <<elseif $customSlave.age < 30>>25-29 years old.
-<<elseif $customSlave.age < 40>>30-39 years old.
+<<elseif $customSlave.age < 40 && $retirementAge >= 40>>30-39 years old.
+<<elseif $customSlave.age < 40 && $retirementAge >= 30>>30+ years old.
 <<elseif $customSlave.age < 50 && $retirementAge >= 50>>40-49 years old.
 <<elseif $customSlave.age < 50 && $retirementAge >= 40>>40+ years old.
 <<elseif $customSlave.age < 60 && $retirementAge >= 60>>50-59 years old.
diff --git a/src/utility/slaveCreationWidgets.tw b/src/utility/slaveCreationWidgets.tw
index f650abb527bd57d83a7f6b87f274981f50c48a5e..f13d1a17c6b7b4105196b04dc33a1ac2d2400442 100644
--- a/src/utility/slaveCreationWidgets.tw
+++ b/src/utility/slaveCreationWidgets.tw
@@ -1342,7 +1342,8 @@
 		<<elseif $customSlave.age < 20>>18-19 years old.
 		<<elseif $customSlave.age < 25>>20-24 years old.
 		<<elseif $customSlave.age < 30>>25-29 years old.
-		<<elseif $customSlave.age < 40>>30-39 years old.
+		<<elseif $customSlave.age < 40 && $retirementAge >= 40>>30-39 years old.
+		<<elseif $customSlave.age < 40 && $retirementAge >= 30>>30+ years old.
 		<<elseif $customSlave.age < 50 && $retirementAge >= 50>>40-49 years old.
 		<<elseif $customSlave.age < 50 && $retirementAge >= 40>>40+ years old.
 		<<elseif $customSlave.age < 60 && $retirementAge >= 60>>50-59 years old.