Changed a check in addFIle to use array_key_exists instead of isset when checking if the resource already exists.