stream was hanging at the end.