Fix issue with reversal of file check