update test and fix some minor bug