change the code of debug thread in cos_loader