finish adding multi-threaded techniques for handling timeouted queries