Use toObject() rather than toJSON()