add timeout to stream