corrected error with setting up copying context for stream