diff --git a/NPSimulation/Process/BeamReaction.cc b/NPSimulation/Process/BeamReaction.cc
index 32a54e0eb2bae27b18cecc415ac0e6ffe8b79e6a..f87e3afe7e588e1b266fc7514b040b9325a1a176 100644
--- a/NPSimulation/Process/BeamReaction.cc
+++ b/NPSimulation/Process/BeamReaction.cc
@@ -127,8 +127,12 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) {
   bool is_first = (to_entrance==0);
 
   if(is_first && m_shoot){
-    std::cout << "Something went wrong in beam reaction, m_shoot cannot be true at beginning of event" << std::endl;
+ /*   std::cout << "Something went wrong in beam reaction, m_shoot cannot be true at beginning of event" << std::endl;
     std::cout << "rand: " << m_rand << std::endl;
+    std::cout << "length: " << m_length << std::endl;
+    std::cout << "step: " << m_StepSize << std::endl;
+    std::cout << "Z: " << m_Z << std::endl;
+    std::cout << "S: " << m_S << std::endl;*/
     m_shoot = false;
   }
 
@@ -141,9 +145,11 @@ G4bool NPS::BeamReaction::ModelTrigger(const G4FastTrack& fastTrack) {
     m_shoot=true;
   }
   
-  // curviligne coordinate along beam patch
-  double S = to_entrance - 0.5*(to_exit+to_entrance); 
-  m_length = m_Z-S;
+  // curviligne coordinate along beam path
+  m_S = to_entrance - 0.5*(to_exit+to_entrance); 
+  m_length = m_Z-m_S;
+
+  m_StepSize = PrimaryTrack->GetStepLength();
   // If the condition is met, the event is generated
   if (m_shoot && m_length < m_StepSize) {
     if(m_ReactionType=="QFSReaction"){
@@ -176,7 +182,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack,
 
   // std::cout << "DOIT" << std::endl; 
   m_shoot=false;
-
+  m_length=abs(m_length);
   // Get the track info
   const G4Track* PrimaryTrack = fastTrack.GetPrimaryTrack();
   G4ThreeVector  pdirection   = PrimaryTrack->GetMomentum().unit();
diff --git a/NPSimulation/Process/BeamReaction.hh b/NPSimulation/Process/BeamReaction.hh
index 2d1dc6336f7d442b22ba2587a5166f8fff4d6b65..212d64f1c1b9763a7f00362f15868c804833f5d7 100644
--- a/NPSimulation/Process/BeamReaction.hh
+++ b/NPSimulation/Process/BeamReaction.hh
@@ -52,6 +52,7 @@ namespace NPS{
       bool   m_shoot;
       double m_StepSize;
       double m_Z;
+      double m_S;
       double m_rand;
       double m_length;
       int    m_Parent_ID;