handle nested arrays which contain null values