fix search bugs, still one bug remain