Fixing file validation