Handle child elements in the links
Correctly identify when to toggle