Fixing pagination on search