       return
 
     legislationId = new ObjectId(job.data.legislationId)
+    sessionId = new ObjectId(job.data.sessionId)
 
     committeesArray = if job.data.legislationDetail.Committees.CommitteeListing.map?
       job.data.legislationDetail.Committees.CommitteeListing

      [job.data.legislationDetail.Committees.CommitteeListing]

    committeeAssemblyIds = committeesArray.map (committee) ->
      console.log(committee)
      Number(committee.Id)

    db.collection("committees").find(assemblyId: {"$in": committeeAssemblyIds}).toArray (err, results) -> ifSuccessful err, callback, ->
      committeeObjectIds = results.map((_) -> _._id)

      db.collection("legislation").update {_id: legislationId}, {"$set": {"committees": committeeObjectIds}}, (err) ->

  jobs.process 'import legislation detail', 5, (job, callback) ->
    # Ensure legislation object ID is in the proper format
    job.data.legislation._id = new ObjectId(job.data.legislation._id)
    job.data.legislation.sessionId = new ObjectId(job.data.legislation.sessionId)

    getLegislationDetailArgs =
      LegislationId: job.data.legislation.assemblyId

    client.LegislationService.BasicHttpBinding_LegislationSearch.GetLegislationDetail getLegislationDetailArgs, (err, result, raw) -> ifSuccessful err, callback, ->
      persistLegislationDetail(job.data.legislation, result.GetLegislationDetailResult, db, jobs, callback)

  jobs.process 'import legislation detail for session', 5, (job, callback) ->
    # Ensure object IDs are in the correct format.
