if/else nesting mistake?