fixed unset encoding bug