modify decoder and encoder