If statement problem

@garyowenschofield sorry, I had a typo. fixed.