Fix encode probrem