fix bugs in global variable class