                 # choose newest in the datacenter -- this one is easiest to get up to date
                 dest = d[0]
                 for i in [1...d.length]
-                    if d[i].version > dest[i].version
+                    if d[i].version > dest.version
                         dest = d[i]
                 send
                     project_id : opts.project_id

        force      : true
        cb         : undefined

    tmp = "/home/storage/.storage-#{opts.project_id}-src-#{opts.source.host}-#{opts.source.version}-dest-#{opts.dest.host}-#{opts.dest.version}"
    f = filesystem(opts.project_id)
    async.series([
        (cb) ->
            # check for already-there dump file

        (cb) ->
            # dump range of snapshots
            start = if opts.dest.version then "-i #{f}@#{opts.dest.version}" else ""
            clean_up = true
            execute_on
                host    : opts.source.host
                command : "sudo zfs send -RD #{start} #{f}@#{opts.source.version} | lz4c -  > #{tmp}"
                cb      : (err, output) ->
                    winston.debug(output)
                    if output.stderr
                        err = output.stderr
                    cb(err)
        (cb) ->
            # scp to destination
