fix bug in test cases