better test if ES, or file