     JAccount.some { referrerUsername : username }, options, callback
 
 
-  @addExtraReferral: secure (client, options, callback)->
+  @addExtraReferral = secure (client, options, callback)->
 
     {delegate} = client.connection
     unless delegate.can 'administer accounts'

          return callback null, referral


  do ->

    JAccount.on 'AccountRegistered', (me, referrerCode)->

    persistReferrals = (campaign, source, target, callback)->

      referral = null

      type     = campaign.campaignType
      unit     = campaign.campaignUnit
      originId = target.getId()

      queue = [

        ->

          referral = new JReferral {
            amount         : campaign.campaignPerEventAmount or 256
            sourceCampaign : campaign.name
            referredBy     : source.getId()
            originId, type, unit
          }

          referral.save (err) ->
            return callback err  if err
            queue.next()

        ->

          options = { originId, type, unit }

          JReferral.calculateAndUpdateClaimedAmount options, (err)->

            return callback err  if err
            queue.next()

        ->

          campaign.increaseGivenAmountSpace (err)->
            console.error "Couldnt decrease the left space", err  if err?
            callback null

      ]

      daisy queue


