add condition check for non-existing agent