         context[model_name + '_url'] = model.url
         context[model_name + '_cid'] = model.cid
     else
+      if not @model
+        throw 'CompositeModelView : error : model is not set'
       context =
         model: @model.toJSON()
         cid: @model.cid
         url: @model.url
-      if not @model
-        throw 'CompositeModelView : error : model is not set'
 
     @_rendered = true
     template_result = render do @get_template, context

    e.preventDefault()
    @save

  keyup: (e) =>
    data = Backbone.Syphon.serialize(@)
    @model.set data

    el = @$el.append(childEl)

  remove: (model) =>
    _viewToRemove = _.where @_child_views, (view) -> view.model is model
    if not _viewToRemove or not _viewToRemove[0]
      throw "BaseCollectionView : error : couldn\'t find view to remove from collection corresponding to model #{model.cid}"
    viewToRemove = _viewToRemove[0]
