adding decoding logic