         catch e
             return
 
-        if typeInfo.name is 'MODELS'
+        if typeInfo.equals 'MODELS'
 
             ids = model[idPropName]
             return if not Array.isArray ids

        if subModelName = typeInfo?.model

            # creates submodels
            if typeInfo.name is 'MODELS' and Array.isArray value
                @setSubModelArrToModel(model, prop, value, subModelName)
                return

            # creates submodel
            if typeInfo.name is 'MODEL'
                @setSubModelToModel(model, prop, value, subModelName)
                return



            model.setRelatedModels(prop, subModels)

        else # if typeInfo.equals 'MODEL'

            id = model[idPropName]
            subModel = repository.getByIdSync(id)
