fixed typo in logic