fixing global variable leak, whoops