created function switcher with ui