Fixing if structure