fix locale crashing critical bug