Changed recognize logic.