Added more paginating logic.