FIX bug of search, testcases added