bug fix, we should capture shared_ptr in lambda, otherwise the instance does not exist when the lambda is called