improve locale handler