That's a quick fix to the problem, but I'd like to avoid using global variables. Too many globals are a sign of bad programming...