IO stream needs to be closed consistently.