close the output stream, use setType instead of mime type extra