Started upating sl.struct.toObject with object output for better handling of errors