fixed if/else statement