If in your design, an interrupt can occur during EEPROM write, then use GIE bit to disable temporary all interrupts. After WRITE enable GIE again. Thats all.

Ioannis