fixed the UnicodeDecode error using smart_str, closes #287