implemented pagination of search results