move ExtendGlassFrame call outside if/else