finish extract tag from doc function