is this double nested if statement needed?