add mime type and buffered writer