tests

fixed a leaking global variable