fix binary encoding problem