array to array map index issue fix