Updated search to handle search and pages
Merge