added check for missing agent token
added more logic for missing agent tokens
update
update