fix refactor bug with loading styles on refresh