fix nested arrays