catch and handle invalid locales