binary search: fix bug