fixed a problem with stacked if/else blocks