close output stream