fixed a memeory bug in the test framework