Added dependency resolving for self references

what is the purpose of <th>xxx</th>?