Improve the parent_link_active logic