now it will automatically remove error quest from loop
reconstruct the multithread behaviour to reduce risk of race competition