modification of pagination in lib-main.php