Fix a mistake in the determineAdapter method