IMHO something is not right with this line

 Code:
IF UBound($aResult) < ($MaxSess + 1)


You made the comment that:
 Quote:
2 header lines, plus max 2 sessions


If $MaxSess = 2, and you +1, that's not quite the 4 lines involved with '2 header lines, plus 2 exe lines'. Or am I missing something with that?

In just toying around with it (changing the $MaxSess value, changing the + value) I am unable to get the script to ever hit it's "ELSE" value.

TS