fix some bug and update test case