crutchy fix for global variables