fix global variable initialization