Close handle after parsing the tags