fix charset and element undefined