stop search results from re-rendering and make more functional code