Why do you need this `element.attributes` check?