Fixed duplicate if.