Fix incorrect if else