`isset($files)` will always return `true` as it was set before... you should use `!empty($files)`