oops, wasn't allocating enough temp memory