handle the array case