Look up the rules for addition and you will find that when you add two arrays, you can only add elements that exist(in both arrays). Otherwise, there is nothing to add. If your shift register is uninitialized, then that's your problem.
Two solutions:
1... If you know the size ahead of time, then initialize an array of that size with zeroes, and wire that to the outside of your shift reg.
2... You could detect I = 0, and replace the array with your new data on the 0th iteration, regardless of the mode switch. In other words do not perform an ADD if there's nothing there yet.
Either one of these is preferable to using the data from an uninitialized Shift reg. The data might not exist, or it might be leftover from your last run an hour ago.