Fix the if statement's logic to match what I intended