bug fix for utf-8 invalid chars