commit before removal of shared_ptr