adding loop for fetch pages