close stream