fixing pagination on search resutls