fixes NPE in search.