You may find strange things start to happen after your code has been running for a while because you are using the String class on a real Uno.
Use of the String class can cause memory contamination. Better to use strings (null terminated character arrays).