Make the pagination work on search results