fix logic typos