fix unending stream