debug toJSON method