fixed global variable re-init