Add page titles
Improve duplicate detection logic