add encode, not finish