fix for global var