Fixed closing stream