bug fix on slicing