diff --git a/plasmid/source/core-plugins/newbrowser/1/dss/reporting-plugins/newbrowserapi/script.py b/plasmid/source/core-plugins/newbrowser/1/dss/reporting-plugins/newbrowserapi/script.py
index 2b46f7323a53690effcb897f9e5033faad9f5e15..720e0004284839d1c97d217039b707a9764a6272 100644
--- a/plasmid/source/core-plugins/newbrowser/1/dss/reporting-plugins/newbrowserapi/script.py
+++ b/plasmid/source/core-plugins/newbrowser/1/dss/reporting-plugins/newbrowserapi/script.py
@@ -249,7 +249,14 @@ def copySample(tr, parameters, tableBuilder):
 	if sampleChildren != None:
 		for sampleChildIdentifier in sampleChildren:
 			child = tr.getSample(sampleChildIdentifier); #Retrieve Sample child to copy
-			copyChildCode = parameters.get("sampleCode") + child.getCode()[child.getCode().index('_'):];
+			
+			copyChildCode = None
+			try: #For autogenerated children that have the code as sufix
+				indexFromCopiedChildrenParentCode = child.getCode().index('_')
+				copyChildCode = parameters.get("sampleCode") + child.getCode()[indexFromCopiedChildrenParentCode:];
+			except: #For all other children
+				copyChildCode = parameters.get("sampleCode") + "_" + child.getCode();
+
 			copyChildIdentifier = "/" + parameters.get("sampleSpace") + "/" + copyChildCode;
 			
 			# Create new sample children