What was wrong with this outside the if/else?