fixed logic typo