support to null items in array (previous code was ignoring null items)