String are the not the recommended way to use with Arduino although try using single parameter instead of two like substring(1) and let me know
char data[5];
for(int i=0;i <5 ;i++)
{
data[i]=Serial.read();
}
char data1=data[0];
char data2=data[1];
an so on and so forth ..