fixed agent die() bug with links

Had to iterate backwards since the array gets shortened each iteration.