changed the else statement to a nested if

changed the else statement to a nested if