update some global variables in main.c