add some robustness to the languages switcher