fixing encoding bug