only allocate page_types array once