fixed an encoding bug