Updated faulty if statement