Use setAttributes instead of addAttributes to replace existing attributes when link is set to active.