fix multi-dim array