fix slice generation