fixed counting of slices for log output