Fix scope to variable group_element in buildHTMLElement function.