                                 ttl           : 60*60*24*14  # valid for 14 days
                                 cb            : cb
                     (cb) =>
-                        if done
+                        if locals.done
                             cb()
                         else
                             @database.when_sent_project_invite

                                    if err
                                        cb(err)
                                    else if when_sent >= misc.days_ago(7)   # successfully sent < one week ago -- don't again
                                        done = true
                                        cb()
                                    else
                                        cb()

                    # at least we can limit its size.
                    cb("email address must be at most 128 characters: '#{email_address}'")
                    return

                locals =
                    done       : false
                    account_id : undefined
                    settings   : undefined

                async.series([
                    # already have an account?
