Fixed global variable.

Fixed an issue with the global variable being stomped on.