Close the correct tag