diff --git a/dis/dis.sh b/dis/dis.sh
index 977f331270988fa415132a45c5e92601ca0b28e9..7c68e130ef94d42141529c1140bd0006f2eecd21 100644
--- a/dis/dis.sh
+++ b/dis/dis.sh
@@ -46,12 +46,6 @@ export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 ## TODO remove this
 #bash util/build_detector.sh
 
-g++ dis/src/pythia_dis.cc -o pythia_dis  \
-   -I/usr/local/include  \
-   -O2 -std=c++11 -pedantic -W -Wall -Wshadow -fPIC  \
-   -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lpythia8 -ldl \
-   -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lHepMC3
-
 
 ## =============================================================================
 ## Step 2: Run the simulation
diff --git a/dis/gen.sh b/dis/gen.sh
index 5a4c4aeb0b0a71fe277e12fd26a294433d719d4f..6c52e9016355288f49eccefd971837d759525487 100644
--- a/dis/gen.sh
+++ b/dis/gen.sh
@@ -35,7 +35,18 @@ JUGGLER_FILE_NAME_TAG="dis"
 ## =============================================================================
 ## Step 1: Dummy event generator
 ## TODO better file name that encodes the actual configuration we're running
-root -b -q "dis/generator/gen_central_electrons.cxx(${JUGGLER_N_EVENTS}, \".local/${JUGGLER_FILE_NAME_TAG}.hepmc\")"
+
+g++ dis/src/pythia_dis.cc -o pythia_dis  \
+   -I/usr/local/include  \
+   -O2 -std=c++11 -pedantic -W -Wall -Wshadow -fPIC  \
+   -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lpythia8 -ldl \
+   -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lHepMC3
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR compiling pythia"
+  exit 1
+fi
+
+./pythia_dis
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running script"
   exit 1