this fixed a memory leak, but caused bulk indexing to fail. reverting for now.