countdown function called last line of streamCreatedHandler