fixed bad duplication of shared pointer.