pagination working (with js error in console)