fix chara code bugs