diff --git a/patch-control.sh b/patch-control.sh
index afa559480065b50dd7cb48b145e5ba979795e742..5eea432ebd7e77e76a609e85279d173b1caba179 100644
--- a/patch-control.sh
+++ b/patch-control.sh
@@ -29,7 +29,7 @@ function on_exit() {
     rm_lock
   fi
 
-  for pid in ${PROCS}; do
+  for pid in ${PROCS[*]}; do
     kill -9 ${pid}
   done
 }
@@ -137,8 +137,7 @@ run_number=`get_run_number`
 
 daq_log_file=~/.km3_private/daq_${run_number}.log
 JGetMessage -H localhost -T MSG -d 3 >${daq_log_file} &
-PROCS=(${PROCS} $!)
-## impl: get the pid and add to the list of must_kill_at_the_exit
+PROCS=(${PROCS[*]} $!)
 
 # Copy selected run setup file, changing the run number
 cat ${rs_file} | sed -e 's/RUNNUMBER/${run_number}/' >dm.detectorfile
@@ -147,7 +146,7 @@ run_start_time=`nowUTC`
 
 # Launch the DM
 dm_driver ${run_duration} | mono DetectorControl.exe --control --reset &
-PROCS=(${PROCS} $!)
+PROCS=(${PROCS[*]} $!)
 
 # Launch the DAQ
 log "Launching the DAQ with the following command line: daq.sh ${run_number} ${run_start_time} ${run_duration}"