fixed usage of array_slice