fixed compiling error caused by undefined smart pointer behavior.