pass toJSON options to recursive calls