Modified addPageTypes function