fixed search crashing - close #663