fixed smart pointer problem