fix the flicker issue