Use key variable instead of pathname

`key` variable is not used, but I guess that instead of `pathname` it should be `key` that is `pathname || files[0]`.

Is that correct?