added setlocale() call