replace switch_theme function