 		userId = AuthenticationController.getLoggedInUserId(req)
 
 		TeamInvitesHandler.getInvite token, (err, invite, teamSubscription) ->
-			next(err) if err?
+			return handleError(err, req, res, next) if err?
 
-			unless invite?
+			if !invite
 				return ErrorController.notFound(req, res, next)
 
 			SubscriptionLocator.getUsersSubscription userId, (err, personalSubscription) ->
-				return callback(err) if err?
+				return handleError(err, req, res, next) if err?
 
 				res.render "subscriptions/team/invite",
 					inviterName: invite.inviterName

		email   = req.body.email

		TeamInvitesHandler.createInvite teamManagerId, email, (err, invite) ->
			next(err) if err?
			inviteView = { user:
				{ email: invite.email, sentAt: invite.sentAt, holdingAccount: true }
			}

		teamManagerId = AuthenticationController.getLoggedInUserId(req)

		TeamInvitesHandler.revokeInvite teamManagerId, email, (err, results) ->
			return handleError(err, req, res, next) if err?

			res.sendStatus 204

handleError = (err, req, res, next) ->
	if err.teamNotFound or err.inviteNoLongerValid
		ErrorController.notFound(req, res, next)
	else
		next(err)
