Added ordering for getPages helper