                 # 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

                command : "cat #{tmp} | lz4c -d - | sudo zfs recv #{force} #{f}; rm #{tmp}"
                cb      : (err, output) ->
                    winston.debug(output)
                    cb(err)
    ], (err) ->
        # remove the lock file
        execute_on
            host    : opts.source.host
            command : "rm #{tmp}"
            cb      : (err) ->
                opts.cb?(err)
    )



        force      : true
        cb         : undefined

    if opts.source.version == opts.dest.version
        # trivial special case
        opts.cb()
        return

    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)
    clean_up = false
    async.series([
        (cb) ->
            # check for already-there dump file
