decode and encode updated