added better handling for timing out streams