fixing random test failure
I haven't profiled yet, but tackling the obvious memory leak