use unique_ptr for subscription, lock data