AJAX pagination - fixed bug