fix data slicing