Update encoding and catch error