slice_idx function

check and format slice name