fix logic typo