add multi source support and tab switch