repair encoding problem