atmega 328 serial problem

Job ID: 31362373

Budget: ₹600 – ₹1,500 INR

i have an esp connected to at 328 via serial
at 328 is driving 2 relay
device is powered from a 5v 2Amp ac to dc smps

the program runs smooth for sometime then randomly stops responding to serial command from esp
at 328 is running as usual just not responding to serial

when this happened i can confirm esp is sending serial data but at328 is not processing it
need someone to fix this asap

AT 328 loop section code
if(Serial.available())
{
String serialMessage = Serial.readStringUntil('\r\n');
processSerialMyData(serialMessage);
}