Fix flash on resize issue