update of encode