Deal with the encode problem.