add json encode and change exec