fixed global variable declarations in global scope