fix slicing issue