create a search page conditionally