fix bug encoding.