--- a/RUN
+++ b/RUN
@@ -297,6 +297,9 @@
 # run FEAT
 fsl:exec "${FSLDIR}/bin/feat ${FEEDSDIR}/results/design.fsf"
 
+# wait for FEAT to finish (in case of cluster job submission)
+exec sh -c "while \[ ! -f ${FEEDSDIR}/results/fmri.feat/cluster_zfstat1_std.txt \]; do sleep 5; done"
+
 puts "checking error on filtered functional data:"
 perror fmri.feat/filtered_func_data 0.1
 puts "checking error on raw Z stat images:"
@@ -397,6 +400,9 @@
 fsl:exec "cp -r $FEEDSDIR/data/fdt_subj1 $FEEDSDIR/results"
 fsl:exec "unset FSLMACHINELIST; ${FSLDIR}/bin/bedpostx $FEEDSDIR/results/fdt_subj1 -n 1"
 
+# wait for FEAT to finish (in case of cluster job submission)
+exec sh -c "while \[ ! -f ${FEEDSDIR}/results/fdt_subj1.bedpostX/merged_th1samples.nii.gz \]; do sleep 5; done"
+
 puts "checking error on bedpost output:"
 perror fdt_subj1.bedpostX/dyads1 .005
 perror fdt_subj1.bedpostX/mean_f1samples .005
