diff --git a/src/matlab/+D3d/+UI/+Ctrl/SetUserData.m b/src/matlab/+D3d/+UI/+Ctrl/SetUserData.m
index 4effcdf847cb4cb43c32d2f875a61c79ce2f1956..0893477c0347acd8d7bf7a6a38aae0ac92a35abb 100644
--- a/src/matlab/+D3d/+UI/+Ctrl/SetUserData.m
+++ b/src/matlab/+D3d/+UI/+Ctrl/SetUserData.m
@@ -1,14 +1,14 @@
 function SetUserData(imageData,colors,channelData)
-global D3dUICtrlHandles
+    global D3dUICtrlHandles
 
-if (~isempty(D3dUICtrlHandles))
-    data = struct('imageData',imageData,'colors',colors,'channelData',channelData);
-    for c=1:length(channelData)
-        channelData(c).color = colors(c,:);
+    if (~isempty(D3dUICtrlHandles))
+        data = struct('imageData',imageData,'colors',colors,'channelData',channelData);
+        for c=1:length(channelData)
+            channelData(c).color = colors(c,:);
+        end
+        set(D3dUICtrlHandles.hObject,'UserData',data);
+    else
+        error('There is no UserData stored in the control window!');
     end
-    set(D3dUICtrlHandles.hObject,'UserData',data);
-else
-    error('There is no UserData stored in the control window!');
-end
 end