fixing bug to handle the case of a span within the 'a' tag containing name