repaired broken encoding