implement transform stream