Adding pages retrieval function