copy rather than reference on stash out

trying to close the memory leak