changed decoding proc and added specify decoder option