work on encoding bug