fix control for use of sharedPtr's