fixed the logic updating the style sheets.