protocol decode method