adding detached stream support