changing the countriesCodes variable to a global var