Fix typo in logic