fix use global variable