trying to fix thread exhaustion.