fixed setlocale bug