improve encoding problem