add output stream support