fixed logic.