code to check for dead/missing links