possible solutions for bug of encoding