diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp
index e0ae2dc4d79a4cff1f65e802fc6f8e36161caeb8..3c711c0ef24f0c8ac1b75e3d7a611589f920e808 100644
--- a/DDG4/src/Geant4InputHandling.cpp
+++ b/DDG4/src/Geant4InputHandling.cpp
@@ -431,7 +431,7 @@ int dd4hep::sim::generatePrimaries(const Geant4Action* caller,
   auto const* primHandler = dynamic_cast<const Geant4PrimaryHandler*>(caller);
   auto const& rejectPDGs = primHandler ? primHandler->m_rejectPDGs : std::set<int>();
 
-  caller->debug("Rejecting PDGs: %s", [&rejectPDGs](){ std::stringstream str; for (int i: rejectPDGs) { str  << i << ", "; } return str;}().str().c_str());
+  caller->debug("Rejecting PDGs: %s", [&rejectPDGs]{ std::stringstream str; for (int i: rejectPDGs) { str << i << ", "; } return str.str();}().c_str());
 
   if ( interaction->locked )  {
     caller->abortRun("Locked interactions may not be used to generate primaries!",