Fix test failure because of global variable changed