close the output stream