fix flashing on page load