add timeout for searchpairpos()