refactor send_stream