fix Multi thread and bug