fixed slicing error