fixing a globals issue