added two tests and closed outstream