   meta.url = undefined if meta.url is meta.original
 
   if meta.doi
+    done = 0
+    suitable = false
     API.log 'Resolving for DOI', doi: meta.doi
-    for src in sources
+    _doi = (src) ->
       if src isnt 'oabutton' and (src isnt 'eupmc' or (not meta.pmid and not meta.pmc)) # because we try eupmc directly earlier if these are present, so don't run again
         try
           # will only work for use endpoints that provide a doi method

    if meta.title
      meta.title = unidecode meta.title
      meta.titles = true
      API.log 'Resolving for title', title: meta.title
      for src in sources
        if src isnt 'oabutton'
          try
            # will only work for use endpoints that provide a title method

            meta.source = src
            meta.licence ?= res.best_oa_location?.license
            meta.journal = res.journal?.title?.split('(')[0].trim()
            suitable = not all and res.redirect isnt false

    for sr in sources
      if parallel
        (() ->
          src = sr
          Meteor.setTimeout (() ->
            _doi src
            done += 1) , 10
        )()
      else
        _doi sr
        return meta if suitable
    while done isnt sources.length
      if suitable
        return meta
      else
        future = new Future();
        Meteor.setTimeout (() -> future.return()), 500
        future.wait()

  if titles
    if not meta.title and meta.doi
