fix error with nested arrays