change raw pointer to shared pointer