fixing file validation