Trying a fix for global variable