         options?.success?()
 
     if options.sharejsDoc
-      @_syncDoc = options.sharejsDoc
+      @_setShareJSDoc options.sharejsDoc
 
     if @_syncDoc.type.name isnt "json"
       throw new Error "The ShareJS document type must be 'json', not '#{ @_syncDoc.type.name }'"

    @_addingQueue = []

    if opts.sharejsDoc
      @_syncDoc = opts.sharejsDoc

    if not @collectionId = opts.collectionId
      throw new Error "SharedCollection needs a collectionId in options!"


    @add model, options
    return model

  _setShareJSDoc: (doc) ->
    @_syncDoc = doc
    doc.connection.on "disconnect", =>
      @trigger "disconnect", this, doc

  fetch: (options={}) ->
    # Fetch can be called only once
