fix #160: don't encode params twice