fixed encoding bug