fix global vars