remove direct dom calls from search function