fix eeprom function