Bug with closed stream