fix bug in theme switching