fix bugs
fixed all the bugs~~~~!
add multi-thread safty