fixed the issue where an optgroup tag right after a psudo tag wouldn't handle both closing tags