add new test script and fix a bug