diff --git a/Simulation/DetSimCore/src/DetSimAlg.cpp b/Simulation/DetSimCore/src/DetSimAlg.cpp
index 8be8d26946a5186eea1c26ee861fa72f3a7e92d1..209a51f09903540540992818266e898502a1e5d6 100644
--- a/Simulation/DetSimCore/src/DetSimAlg.cpp
+++ b/Simulation/DetSimCore/src/DetSimAlg.cpp
@@ -1,4 +1,7 @@
 #include "DetSimAlg.h"
+#include "GaudiKernel/IEventProcessor.h"
+#include "GaudiKernel/IAppMgrUI.h"
+#include "GaudiKernel/GaudiException.h"
 
 #include "G4RunManager.hh"
 
@@ -60,7 +63,7 @@ DetSimAlg::initialize() {
         info() << "Start Geant4 Visualization." << endmsg;
         // initialize Vis
         visManager = new G4VisExecutive;
-        char* argv[1] = {"geant4Vis"};
+        char* argv[1] = {strdup("geant4Vis")};
         ui = new G4UIExecutive(1,argv);
     }
     for (auto vismac: m_vis_macs.value()) {
@@ -89,6 +92,20 @@ DetSimAlg::initialize() {
         delete visManager;
 
         // fixme: how to stop the run?
+        // auto ep = serviceLocator()->as<IEventProcessor>();
+        // if ( !ep ) {
+        //     error() << "Cannot get IEventProcessor" << endmsg;
+        //     return StatusCode::FAILURE;
+        // }
+        // ep->stopRun();
+
+        // auto ep = serviceLocator()->as<IAppMgrUI>();
+        // if ( !ep ) {
+        //     error() << "Cannot get IAppMgrUI" << endmsg;
+        //     return StatusCode::FAILURE;
+        // }
+        // ep->terminate();
+        // throw GaudiException( "Stopping loop", "Stop", StatusCode::SUCCESS);
         return StatusCode::FAILURE;
     }