adding params to encode method