added generic nested array handler