fix bugs raised by tester