trying to fix the global var