Check .getAttribute before use on topLevelTarget