rewrite dtstream with bind&function