prototype was causing weirdness in search, changing back to function