refactor(pagination): change the way `num-pages` is assigned