fixed thread bugs in sim_manager, generated traces