Moved $.get out of search function