fixing bugs with locale checks