read stdout before stderr.