only search for end tag after the index of start tag