fix nightmode flashing