fix bugs for test