removed nested if statement

removed nested if statement