fixed inner-if etc