fix bug in ExtractAnchor