eeprom: fix eeprom write procedure