use shared_ptr and fixed crash related to the overriding of restarted pollings