add extern to global vars