fix mb_chars for nil error