changed location of applyStyledFrame to occur directly after styling