fix binary search bug.