Fix issue with flickering