fixed global.size reset issue