Fix flicker problem