The temp1 was an issue with the HTML format. I have corrected that.
In reply to Re^2: Variable scope issue by crickson in thread Variable scope issue by crickson