fixed the bug in the test code