fix flashing with custom styles