fixed a problem with Binary search