change from unique pointer to shared pointer, and use shared pointer within action