fixed bug when the app would return from the background and complain about accessing an empty array e.g. array[0] but array is empty