only json encode once

fix #13