File detection fix