improve stdout reader