fixing the slicing problem