add file.kind == "file" when handling .files