Preventing undefined array processing