fix a terrible extra O(n) copy