fixed wrong encoded json on truncate