fix compile error due to boost::make_shared

boost::make_shared takes a const ref. To pass a non const ref, we wrap the argument in boost::ref.