adapt to changed stream api