diff --git a/ecal/emcal_electrons.sh b/ecal/emcal_electrons.sh
index 9e387ae06c9686f8bfebdc367c6ac3aea7d9600d..5a8b182330abde55d5830d074e8802f2b11516f1 100644
--- a/ecal/emcal_electrons.sh
+++ b/ecal/emcal_electrons.sh
@@ -101,7 +101,7 @@ fi
 #root -b -q "ecal/scripts/read_eng.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\", \"results/eng_${JUGGLER_FILE_NAME_TAG}.txt\")"
 #root -b -q "ecal/scripts/cal_eng_res.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\")"
 
-#mkdir -p sim_output
-#cp "${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}" sim_output/.
-#cp "${JUGGLER_DETECTOR}/${JUGGLER_SIM_FILE}" sim_output/.
+if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then 
+cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/.
+fi
 
diff --git a/ecal/emcal_pi0s.sh b/ecal/emcal_pi0s.sh
index fee51297cf5f9b14b8e0322f0777836b21b2570c..e64b76a52ce090f5e6a0d894ab44202b253cb6cf 100644
--- a/ecal/emcal_pi0s.sh
+++ b/ecal/emcal_pi0s.sh
@@ -21,7 +21,15 @@ echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
 # Datasets
 #git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets
 root -b -q "ecal/scripts/emcal_pi0.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running analysis script"
+  exit 1
+fi
 root -b -q "ecal/scripts/emcal_pi0_reader.cxx(\"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running analysis script"
+  exit 1
+fi
 
 # Detector TOPSiDE
 git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
@@ -51,9 +59,18 @@ npsim --runType batch \
       --compactFile ${JUGGLER_DETECTOR}.xml \
       --inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \
       --outputFile  ${JUGGLER_SIM_FILE}
-# Need to figure out how to pass file name to juggler from the commandline
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running npdet"
+  exit 1
+fi
 
+# Need to figure out how to pass file name to juggler from the commandline
 xenv -x /usr/local/Juggler.xenv gaudirun.py ../ecal/options/crystal_calorimeter_reco.py
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running juggler"
+  exit 1
+fi
+
 ls -l
 
 popd
@@ -62,8 +79,12 @@ ls -l
 pwd
 mkdir -p results
 root -b -q "ecal/scripts/makeplot_pi0.C(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running analysis script"
+  exit 1
+fi
 
-mkdir -p sim_output
-cp "${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}" sim_output/.
-cp "${JUGGLER_DETECTOR}/${JUGGLER_SIM_FILE}" sim_output/.
+if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then 
+cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/.
+fi