Fix flicker bug