fixed encoding bug.