updated stream and corrected pty interface