diff --git a/VirtualRobot/Workspace/VoxelTreeND.hpp b/VirtualRobot/Workspace/VoxelTreeND.hpp
index 2c576715b921c101b1ff61f7ad71511afbd98618..26808f210c44fc625ba7a9c7d92fe5e25385c244 100644
--- a/VirtualRobot/Workspace/VoxelTreeND.hpp
+++ b/VirtualRobot/Workspace/VoxelTreeND.hpp
@@ -796,7 +796,7 @@ namespace VirtualRobot
          *  Retruns number of all Nodes, including inner and leaf nodes.
          */
         long getNumNodes() {
-            root->countNodesRecursive();
+            return root->countNodesRecursive();
         }
 
     protected: