close opened stream