add autostart switch functionality