fix global vars.