Fix usage of slice method