Correct way to clear emulated eeprom in MKR series microcontrollers?

Hi, I have a script running on the MKR 1400 board that is designed to reset it periodically nad reset information is saved in the emulated eeprom. After reset the information that is contained in the eeprom is read and uploaded to an FTP server. The eeprom is then cleared.

I am using the FlashAsEEprom library.

The code I am using to clear the eeprom is;

//clear the eeprom
for (int i=0; i<EEPROM.length(); i++) {


This does remove teh previous contents of the eeprom but the call to EEPROM.isValid() still indicates that there is data in the eeprom. Whereas if i reload the script, the first call to EEPROM.isValid() corretly indicates that there is no data in the eeprom.

So, is there a proper way to clear the eeprom so the cal to EEPROM.isValid() returns false.

Any help is much appreciated.