using threading in esgsearch