adds stream existance checking for period switching logic