diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
index f41d962b9a2c2707c36b853c811af924f810fada..cdc6c7222aedf78f03b53f6f45845551f4f4be30 100644
--- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
+++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
@@ -148,7 +148,18 @@ namespace armarx
         }
         else if (layers.find(layerName) != layers.end())
         {
-            selectionNode->deselect(layers.at(layerName).mainNode);
+            for (int i = 0; i < selectionNode->getNumSelected(); i++)
+            {
+                SoPath* path = selectionNode->getPath(i);
+                if (path->containsNode(layers.at(layerName).mainNode))
+                {
+                    selectionNode->deselect(path);
+                }
+            }
+        }
+        else
+        {
+            ARMARX_WARNING << "Could not find layer '" << layerName << "' to clear";
         }
     }