add autoswitch-functionality