adding sort to the params that need to be encoded