Fix flickering visibility issue