program stuck after few hours

Use the F() macro and the _P variants of functions like "strcat_P" more.