add decode method