find error by binary search