fixed if/else statements