ending output stream