added tape switching logic