resolved possible endless loop in eeprom_wait code