switch auto ptr to unique ptr