Fixed the logic in the IF statement.