unit test script bug fix