fixed NPE for search