Fix a memory usage problem