bugfix: stop assuming those global variables are there