Moving the creation of a DOM element into the correct scope to prevent detached DOM tree

There is a creation of an : a : tag inside the urlUtils however it is created in the outer scope of the only function that uses it which seems to cause that a tag to show up as a detached DOM tree.  I have move the creation of that DOM element into the function that uses it in order to prevent the detached DOM tree from happening.