refactor to make changeLanguage global