get rid of global var