Use onthemechange in NTP to handle theme change accurately.