adding pagination to db results when search query is null