diff --git a/+PlotID/@dataPath/dataPath.m b/+PlotID/@dataPath/dataPath.m
index e16488ac94fdca89fef749c3aa3b88a770acf8f7..cb52877d31a85ed3e3535a9626644a214e54ac62 100644
--- a/+PlotID/@dataPath/dataPath.m
+++ b/+PlotID/@dataPath/dataPath.m
@@ -23,8 +23,10 @@ classdef dataPath < handle
 
 
             % handle nested cell arrays
-            while any(cellfun(@iscell,inputPaths))
-                inputPaths = [inputPaths{cellfun(@iscell,inputPaths)} inputPaths(~cellfun(@iscell,inputPaths))]
+            while any(cellfun(@iscell,inputPaths)) % while any of the cells contain cells
+                % concatenate the content of the cells containing cells
+                % with the ones that don't contain cells
+                inputPaths = [inputPaths{cellfun(@iscell,inputPaths)} inputPaths(~cellfun(@iscell,inputPaths))];
             end
 
             isStruct = false([1,numel(inputPaths)]);