stop loop if the nested array is null or other scalar values - fix #13