fix the memory leak in the Node Pool class