updated deprecated method slice_bytes to slice