FIX - change the fix for the case where the array exists but is empty