encoding bug fixed