Fix the pagination issue

the insertBefore() method doesn't choose the appropriate pagination <li> because the method accepts only one parameter.