bug fixing pagination with ajax