fix ambiguous if/else statement