Fix the flickering problem