make decode params work for encoding as well

bug with encode