fixed the bug with getting the wrong locale
Merge pull request #363 from akh81/locale-bug-fix

fixed the bug with getting the wrong locale