   mailTaskName = "employerNewCandidatesAvailableTask"
   lockDurationMs = 2 * 60 * 1000 
   lockManager.setLock mailTaskName, lockDurationMs, (err) ->
-    if err? then return log.error "There was an error getting a task lock!"
-    emailEmployerNewCandidatesAvailable.apply {"mailTaskName":mailTaskName}, (err) ->
+    if err? then return log.error "There was an error getting a task lock!: #{err}"
+    emailEmployerNewCandidatesAvailable.call {"mailTaskName":mailTaskName}, (err) ->
       if err
         log.error "There was an error completing the new candidates available task: #{err}"
       else

  lockDurationMs = 2 * 60 * 1000 
  lockManager.setLock mailTaskName, lockDurationMs, (err) ->
    if err? then return log.error "Error getting a distributed lock for task #{mailTaskName}!"
    emailInternalCandidateUpdateReminder.apply {"mailTaskName":mailTaskName}, (err) ->
      if err
        log.error "There was an error sending the internal candidate update reminder.: #{err}"
      else

  findParameters = 
    "jobProfile.updated":
      $lte: @currentTime.toISOString()
      $gt: @beginningOfUTCDay.toISOString()
    "jobProfileApproved": false 
  User.find(findParameters).select("_id jobProfile.name jobProfile.updated").lean().exec cb
  
