Index: trunk/ippTasks/nightly_stacks.pro
===================================================================
--- trunk/ippTasks/nightly_stacks.pro	(revision 27209)
+++ trunk/ippTasks/nightly_stacks.pro	(revision 27213)
@@ -549,7 +549,9 @@
 	$new_state = "BURNING"
     end
-    if ($btNcounter >= $btN)
+    if ($btNcounter + 1 > $btN)
 	$new_state = "BURNING"
-	$btNcounter = 0
+    end
+    if ($btNcounter > $btN) 
+    	$btNcounter = 0
     end
     if ($VERBOSE > 5) 
@@ -560,4 +562,5 @@
     $counter_update = $btNcounter + 1
     book setword nsBurntool $date btNCounter $counter_update
+    book setword nsData $options:0 nsState $options:1
 
     # Get the current status of this job, and skip if it doesn't need to process.
@@ -602,5 +605,4 @@
 #    convert 'stdout' to book format
     # Set data state based on if we're queueing or waiting
-    book setword nsData $options:0 nsState $options:1
     # Set the job state for success.
     book setword nsBurntool $options:0 $options:2 FINISHED
