Replaced the second if statement for an else statement.