searchFunction fix