fixing publish encoding bug