adding a wait feature to mediastream