deal with nested arrays