Prevent flicker with dark theme