added template for sharedPtr