Why is the last condition no being met?