diff --git a/MeshLib/MeshQuality/MeshValidation.cpp b/MeshLib/MeshQuality/MeshValidation.cpp
index f697a2d91e98f505911a28144a5311f7fa91884a..c3cd73c154b3726c9c88069500b3c8010908e3e2 100644
--- a/MeshLib/MeshQuality/MeshValidation.cpp
+++ b/MeshLib/MeshQuality/MeshValidation.cpp
@@ -156,7 +156,8 @@ unsigned MeshValidation::detectHoles(MeshLib::Mesh const& mesh)
         return 0;
     }
 
-    MeshLib::Mesh* boundary_mesh(MeshSurfaceExtraction::getMeshBoundary(mesh));
+    auto boundary_mesh = MeshLib::BoundaryExtraction::getBoundaryElementsAsMesh(
+        mesh, "bulk_node_ids", "bulk_element_ids", "bulk_face_ids");
     std::vector<MeshLib::Element*> const& elements(
         boundary_mesh->getElements());
 
@@ -174,7 +175,6 @@ unsigned MeshValidation::detectHoles(MeshLib::Mesh const& mesh)
                        sfc_idx.cend(),
                        std::numeric_limits<unsigned>::max());
     }
-    delete boundary_mesh;
 
     // Subtract "1" from the number of surfaces found to get the number of
     // holes.