Remove boost_thread dependency and fix crash