handle maxid for epiquery disconnect scenarios