can you elaborate on why you're using global variables here? it's generally considered bad form, and there are likely better solutions depending on what you need to do (cache, keeping data on the request, etc.)