Fix bug global variable