fix flickering