Index: trunk/ippTasks/detrend.resid.pro
===================================================================
--- trunk/ippTasks/detrend.resid.pro	(revision 12370)
+++ trunk/ippTasks/detrend.resid.pro	(revision 12371)
@@ -167,5 +167,5 @@
     $run = detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE $ARGS
     if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $outroot
+      $run = $run --workdir $WORKDIR
     end
 
@@ -290,5 +290,5 @@
     $run = detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA $ARGS
     if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $outroot
+      $run = $run --workdir $WORKDIR
     end
 
