fixing file check