modify decode encode methods