better handle locale switching