changing toCompactJson