bugfix binary search