fixed bug by adding check when specific subarray element is not defined
trend updates