change pages to array