 							, (err) ->
 								if err?
 									fileCallback err
-									return
-								do parsingFinished
+								else
+									do parsingFinished
 		, (err) ->
 			do updateWatcher
 			

				if auth.packages?
					auth.packages[_package] = createComparator versions for _package, versions of auth.packages
				if auth.groups?
					for group, packages of auth.groups
						auth.groups[group][_package] = createComparator versions for _package, versions of packages
				if auth.users?
					for user of auth.users
						auth.users[user].packages[_package] = createComparator versions for _package, versions of auth.users[user].packages
				logger.log "notice", "Updated auth"
			catch err
				logger.log "error", "error parsing auth.json. Denying access to all packages: #{err}"

		do writer.endElement
		do writer.endDocument
		res.end (do writer.toString).replace /\{\{packageServerHost\}\}/g, host
	
	if req.auth?
		if auth?.users?[req.auth.username]?
			bcrypt.compare req.auth.password, auth.users[req.auth.username].passwd, (err, result) ->
				if err?
					res.send 500, '500 Internal Server Error'
				else if result
					callback req.auth.username
				else
					res.setHeader 'WWW-Authenticate', 'Basic realm="Invalid password or username"'
					res.send 401, 'Invalid password or username'
		else
			res.setHeader 'WWW-Authenticate', 'Basic realm="Invalid password or username"'
			res.send 401, 'Invalid password or username'
	else
		callback ''

