bug fix on chardet