fix an important mistake in bsearch