It wasn't actually checking the value, which it should have been doing. Thus the wrong message was printed.